package com.wowoai.chatai.entity;

import com.wowoai.common.CommonConstant;
import com.wowoai.common.basemodule.BaseEntity;
import com.wowoai.user.enums.RoleEnum;
import com.wowoai.user.enums.UserStatusEnum;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 用户绘画实体
 */
@Getter
@Setter
@Table(name = "user_drawing")
@Entity
public class UserDrawingEntity extends BaseEntity {

    /**
     * 电话号码
     */
    @Column(name = "phone_number")
    private String phoneNumber;

    /**
     * 用户昵称
     */
    @Column(name = "nick_name")
    private String nickName;

    /**
     * 用户id
     */
    @Column(name = "user_id")
    private Long userId;

    /**
     * 绘图得url
     */
    @Column(name = "image_url")
    private String imageUrl;

    /**
     * 绘图得taskId
     */
    @Column(name = "task_id")
    private String taskId;

    /**
     * 描述
     */
    @Column(name = "image_describe")
    private String describe;

    public static UserDrawingEntity create(Long id,String creatorName){
        UserDrawingEntity userEntity = new UserDrawingEntity();
        userEntity.setId(id);
        userEntity.setCreatorId(id);
        userEntity.setDeleted(Boolean.FALSE);
        userEntity.setCreateTime(System.currentTimeMillis());
        userEntity.setCreatorName(creatorName);
        return userEntity;
    }

    public static UserDrawingEntity create(Long id, String creatorName, Long userId, String fileUrl, String phoneNumber, String task_id,String describe) {
        UserDrawingEntity userDrawingEntity = new UserDrawingEntity();
        userDrawingEntity.setId(id);
        userDrawingEntity.setCreatorId(id);
        userDrawingEntity.setDeleted(Boolean.FALSE);
        userDrawingEntity.setCreateTime(System.currentTimeMillis());
        userDrawingEntity.setCreatorName(creatorName);
        userDrawingEntity.setUserId(userId);
        userDrawingEntity.setImageUrl(fileUrl);
        userDrawingEntity.setPhoneNumber(phoneNumber);
        userDrawingEntity.setTaskId(task_id);
        userDrawingEntity.setDescribe(describe);

        return userDrawingEntity;
    }
}
